Optimal. Leaf size=246 \[ -\frac {2 (d+e x)^{m-1} (c d f-a e g) \left (x \left (a e^2+c d^2\right )+a d e+c d e x^2\right )^{1-m} \left (a e^2 g+c d (d g (1-m)-e f (2-m))\right )}{c^3 d^3 e (1-m) (2-m) (3-m)}+\frac {2 g (d+e x)^m (c d f-a e g) \left (x \left (a e^2+c d^2\right )+a d e+c d e x^2\right )^{1-m}}{c^2 d^2 e (2-m) (3-m)}+\frac {(f+g x)^2 (d+e x)^{m-1} \left (x \left (a e^2+c d^2\right )+a d e+c d e x^2\right )^{1-m}}{c d (3-m)} \]
________________________________________________________________________________________
Rubi [A] time = 0.20, antiderivative size = 246, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 44, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.068, Rules used = {870, 794, 648} \begin {gather*} -\frac {2 (d+e x)^{m-1} (c d f-a e g) \left (x \left (a e^2+c d^2\right )+a d e+c d e x^2\right )^{1-m} \left (a e^2 g+c d (d g (1-m)-e f (2-m))\right )}{c^3 d^3 e (1-m) (2-m) (3-m)}+\frac {2 g (d+e x)^m (c d f-a e g) \left (x \left (a e^2+c d^2\right )+a d e+c d e x^2\right )^{1-m}}{c^2 d^2 e (2-m) (3-m)}+\frac {(f+g x)^2 (d+e x)^{m-1} \left (x \left (a e^2+c d^2\right )+a d e+c d e x^2\right )^{1-m}}{c d (3-m)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 648
Rule 794
Rule 870
Rubi steps
\begin {align*} \int (d+e x)^m (f+g x)^2 \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{-m} \, dx &=\frac {(d+e x)^{-1+m} (f+g x)^2 \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{1-m}}{c d (3-m)}+\frac {(2 (c d f-a e g)) \int (d+e x)^m (f+g x) \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{-m} \, dx}{c d (3-m)}\\ &=\frac {2 g (c d f-a e g) (d+e x)^m \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{1-m}}{c^2 d^2 e (2-m) (3-m)}+\frac {(d+e x)^{-1+m} (f+g x)^2 \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{1-m}}{c d (3-m)}-\frac {\left (2 (c d f-a e g) \left (a e^2 g+c d (d g (1-m)-e f (2-m))\right )\right ) \int (d+e x)^m \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{-m} \, dx}{c^2 d^2 e (2-m) (3-m)}\\ &=-\frac {2 (c d f-a e g) \left (a e^2 g+c d (d g (1-m)-e f (2-m))\right ) (d+e x)^{-1+m} \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{1-m}}{c^3 d^3 e (1-m) (2-m) (3-m)}+\frac {2 g (c d f-a e g) (d+e x)^m \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{1-m}}{c^2 d^2 e (2-m) (3-m)}+\frac {(d+e x)^{-1+m} (f+g x)^2 \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{1-m}}{c d (3-m)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.11, size = 131, normalized size = 0.53 \begin {gather*} -\frac {(d+e x)^{m-1} ((d+e x) (a e+c d x))^{1-m} \left (2 a^2 e^2 g^2+2 a c d e g (f (m-3)+g (m-1) x)+c^2 d^2 \left (f^2 \left (m^2-5 m+6\right )+2 f g \left (m^2-4 m+3\right ) x+g^2 \left (m^2-3 m+2\right ) x^2\right )\right )}{c^3 d^3 (m-3) (m-2) (m-1)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [F] time = 0.41, size = 0, normalized size = 0.00 \begin {gather*} \int (d+e x)^m (f+g x)^2 \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{-m} \, dx \end {gather*}
Verification is not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.46, size = 350, normalized size = 1.42 \begin {gather*} -\frac {{\left (a c^{2} d^{2} e f^{2} m^{2} + 6 \, a c^{2} d^{2} e f^{2} - 6 \, a^{2} c d e^{2} f g + 2 \, a^{3} e^{3} g^{2} + {\left (c^{3} d^{3} g^{2} m^{2} - 3 \, c^{3} d^{3} g^{2} m + 2 \, c^{3} d^{3} g^{2}\right )} x^{3} + {\left (6 \, c^{3} d^{3} f g + {\left (2 \, c^{3} d^{3} f g + a c^{2} d^{2} e g^{2}\right )} m^{2} - {\left (8 \, c^{3} d^{3} f g + a c^{2} d^{2} e g^{2}\right )} m\right )} x^{2} - {\left (5 \, a c^{2} d^{2} e f^{2} - 2 \, a^{2} c d e^{2} f g\right )} m + {\left (6 \, c^{3} d^{3} f^{2} + {\left (c^{3} d^{3} f^{2} + 2 \, a c^{2} d^{2} e f g\right )} m^{2} - {\left (5 \, c^{3} d^{3} f^{2} + 6 \, a c^{2} d^{2} e f g - 2 \, a^{2} c d e^{2} g^{2}\right )} m\right )} x\right )} {\left (e x + d\right )}^{m}}{{\left (c^{3} d^{3} m^{3} - 6 \, c^{3} d^{3} m^{2} + 11 \, c^{3} d^{3} m - 6 \, c^{3} d^{3}\right )} {\left (c d e x^{2} + a d e + {\left (c d^{2} + a e^{2}\right )} x\right )}^{m}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.28, size = 981, normalized size = 3.99 \begin {gather*} -\frac {{\left (x e + d\right )}^{m} c^{3} d^{3} g^{2} m^{2} x^{3} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right )\right )} + 2 \, {\left (x e + d\right )}^{m} c^{3} d^{3} f g m^{2} x^{2} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right )\right )} - 3 \, {\left (x e + d\right )}^{m} c^{3} d^{3} g^{2} m x^{3} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right )\right )} + {\left (x e + d\right )}^{m} a c^{2} d^{2} g^{2} m^{2} x^{2} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right ) + 1\right )} + {\left (x e + d\right )}^{m} c^{3} d^{3} f^{2} m^{2} x e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right )\right )} - 8 \, {\left (x e + d\right )}^{m} c^{3} d^{3} f g m x^{2} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right )\right )} + 2 \, {\left (x e + d\right )}^{m} c^{3} d^{3} g^{2} x^{3} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right )\right )} + 2 \, {\left (x e + d\right )}^{m} a c^{2} d^{2} f g m^{2} x e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right ) + 1\right )} - {\left (x e + d\right )}^{m} a c^{2} d^{2} g^{2} m x^{2} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right ) + 1\right )} - 5 \, {\left (x e + d\right )}^{m} c^{3} d^{3} f^{2} m x e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right )\right )} + 6 \, {\left (x e + d\right )}^{m} c^{3} d^{3} f g x^{2} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right )\right )} + {\left (x e + d\right )}^{m} a c^{2} d^{2} f^{2} m^{2} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right ) + 1\right )} - 6 \, {\left (x e + d\right )}^{m} a c^{2} d^{2} f g m x e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right ) + 1\right )} + 6 \, {\left (x e + d\right )}^{m} c^{3} d^{3} f^{2} x e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right )\right )} + 2 \, {\left (x e + d\right )}^{m} a^{2} c d g^{2} m x e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right ) + 2\right )} - 5 \, {\left (x e + d\right )}^{m} a c^{2} d^{2} f^{2} m e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right ) + 1\right )} + 2 \, {\left (x e + d\right )}^{m} a^{2} c d f g m e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right ) + 2\right )} + 6 \, {\left (x e + d\right )}^{m} a c^{2} d^{2} f^{2} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right ) + 1\right )} - 6 \, {\left (x e + d\right )}^{m} a^{2} c d f g e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right ) + 2\right )} + 2 \, {\left (x e + d\right )}^{m} a^{3} g^{2} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right ) + 3\right )}}{c^{3} d^{3} m^{3} - 6 \, c^{3} d^{3} m^{2} + 11 \, c^{3} d^{3} m - 6 \, c^{3} d^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.01, size = 235, normalized size = 0.96 \begin {gather*} -\frac {\left (c d x +a e \right ) \left (c^{2} d^{2} g^{2} m^{2} x^{2}+2 c^{2} d^{2} f g \,m^{2} x -3 c^{2} d^{2} g^{2} m \,x^{2}+2 a c d e \,g^{2} m x +c^{2} d^{2} f^{2} m^{2}-8 c^{2} d^{2} f g m x +2 g^{2} x^{2} c^{2} d^{2}+2 a c d e f g m -2 a c d e \,g^{2} x -5 c^{2} d^{2} f^{2} m +6 c^{2} d^{2} f g x +2 a^{2} e^{2} g^{2}-6 a c d e f g +6 f^{2} c^{2} d^{2}\right ) \left (e x +d \right )^{m} \left (c d e \,x^{2}+a \,e^{2} x +c \,d^{2} x +a d e \right )^{-m}}{\left (m^{3}-6 m^{2}+11 m -6\right ) c^{3} d^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.56, size = 193, normalized size = 0.78 \begin {gather*} -\frac {{\left (c d x + a e\right )} f^{2}}{{\left (c d x + a e\right )}^{m} c d {\left (m - 1\right )}} - \frac {2 \, {\left (c^{2} d^{2} {\left (m - 1\right )} x^{2} + a c d e m x + a^{2} e^{2}\right )} f g}{{\left (m^{2} - 3 \, m + 2\right )} {\left (c d x + a e\right )}^{m} c^{2} d^{2}} - \frac {{\left ({\left (m^{2} - 3 \, m + 2\right )} c^{3} d^{3} x^{3} + {\left (m^{2} - m\right )} a c^{2} d^{2} e x^{2} + 2 \, a^{2} c d e^{2} m x + 2 \, a^{3} e^{3}\right )} g^{2}}{{\left (m^{3} - 6 \, m^{2} + 11 \, m - 6\right )} {\left (c d x + a e\right )}^{m} c^{3} d^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 3.52, size = 327, normalized size = 1.33 \begin {gather*} -\frac {\frac {g^2\,x^3\,{\left (d+e\,x\right )}^m\,\left (m^2-3\,m+2\right )}{m^3-6\,m^2+11\,m-6}+\frac {x\,{\left (d+e\,x\right )}^m\,\left (2\,a^2\,c\,d\,e^2\,g^2\,m+2\,a\,c^2\,d^2\,e\,f\,g\,m^2-6\,a\,c^2\,d^2\,e\,f\,g\,m+c^3\,d^3\,f^2\,m^2-5\,c^3\,d^3\,f^2\,m+6\,c^3\,d^3\,f^2\right )}{c^3\,d^3\,\left (m^3-6\,m^2+11\,m-6\right )}+\frac {a\,e\,{\left (d+e\,x\right )}^m\,\left (2\,a^2\,e^2\,g^2+2\,a\,c\,d\,e\,f\,g\,m-6\,a\,c\,d\,e\,f\,g+c^2\,d^2\,f^2\,m^2-5\,c^2\,d^2\,f^2\,m+6\,c^2\,d^2\,f^2\right )}{c^3\,d^3\,\left (m^3-6\,m^2+11\,m-6\right )}+\frac {g\,x^2\,\left (m-1\right )\,{\left (d+e\,x\right )}^m\,\left (a\,e\,g\,m-6\,c\,d\,f+2\,c\,d\,f\,m\right )}{c\,d\,\left (m^3-6\,m^2+11\,m-6\right )}}{{\left (c\,d\,e\,x^2+\left (c\,d^2+a\,e^2\right )\,x+a\,d\,e\right )}^m} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________